package com.study.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.zaxxer.hikari.HikariDataSource;

@Configuration
public class DynamicDataSourceConfig {
	
	@Bean(name = "ds1")
	@ConfigurationProperties("spring.datasource.hikari.mu")
	public HikariDataSource dataSourceMU() {
		return DataSourceBuilder.create().type(HikariDataSource.class).build();
	}
	

    @Bean(name = "ds2")
//    @Qualifier("ds6")
    @ConfigurationProperties("spring.datasource.hikari.mt")
    public HikariDataSource dataSourceMT(){
    	return DataSourceBuilder.create().type(HikariDataSource.class).build();
    }
}
